package cn.jinbyte.starter.captcha.config;

import cn.jinbyte.starter.captcha.enums.EasyCaptchaType;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.awt.*;

import static cn.jinbyte.starter.captcha.config.StarterConst.CONF_PREFIX;

/**
 * 验证码配置
 */
@Data
@ConfigurationProperties(prefix = CONF_PREFIX + ".easy-captcha")
public class EasyCaptchaProperties {
    /**
     * 验证码类型
     */
    @NotNull
    private EasyCaptchaType type;
    /**
     * 验证码宽度
     */
    private int width = 130;
    /**
     * 验证码高度
     */
    private int height = 48;
    /**
     * 验证码字符长度
     */
    private int length = 4;

    /**
     * 字体
     */
    private Font font;

    /**
     * 验证码过期时间，单位秒
     */
    private long timeout = 180;
}
